package com.atguigu.gmall.component;

import java.util.Map;

/**
 * @author Jerry.Su
 * @Date 2022/2/21 9:31
 */
public class RequestContext {

    static RequestContextStore contextStore;

    static {
        contextStore = RequestContextStore.getInstance();
    }

    public static String getTraceId() {
        return contextStore.getTraceId();
    }

    public static void setTraceId(String traceId) {
        contextStore.setTraceId(traceId);
    }

    public static Map<String, String> getCopyOfContextMap() {
        return contextStore.getCopyOfContextMap();
    }

    public static void setCopyOfContextMap(Map<String, String> map) {
        contextStore.setContextMap(map);
    }

    public static void clear() {
        contextStore.clear();
    }

    public static void removeTraceId() {
        contextStore.removeTraceId();
    }
}
